import request from "@/utils/request";

//apiUrl列表获取
export function getUrlList(query) {
  return request({
    url: "/system/apiinterface/list",
    method: "get",
    params: query,
  });
}
//apiUrl列表获取
export function selectListByUrl(query) {
  return request({
    url: "/system/apiinterface/selectListByUrl",
    method: "get",
    params: query,
  });
}
//启用/停用脱敏策略
export function updateStatus(data) {
  return request({
    url: "/system/sensitiveStrategy/updateStatus",
    method: "post",
    data,
  });
}
//根据apiUrl生成正则规则
export function getRuleByUrl(data) {
  return request({
    url: "/system/sensitiveStrategy/getRuleByUrl",
    method: "get",
    params: data,
  });
}
//根据规则类型获取脱敏规则
export function listByType(data) {
  return request({
    url: "/system/sensitiveRule/listByType",
    method: "get",
    params: data,
  });
}
//脱敏策略修改
export function updateForm(data) {
  return request({
    url: "/system/sensitiveStrategy/update",
    method: "post",
    data,
  });
}

//脱敏策略删除
export function deleteById(data) {
  return request({
    url: "/system/sensitiveStrategy/delete",
    method: "post",
    data,
  });
}

//脱敏策略新增
export function addSensitive(data) {
  return request({
    url: "/system/sensitiveStrategy/add",
    method: "post",
    data,
  });
}

//脱敏策略查询
export function getSensitiveList(data) {
  return request({
    url: "/system/sensitiveStrategy/list",
    method: "get",
    params: data,
  });
}

//脱敏策略详情
export function getInfoById(data) {
  return request({
    url: "/system/sensitiveStrategy/query",
    method: "get",
    params: data,
  });
}

//脱敏策略测试
export function getStrategyTest(data) {
  return request({
    url: "/system/sensitiveStrategy/getStrategyTest",
    method: "post",
    data,
  });
}

//获取全局脱敏策略
export function getAllStrategy(data) {
  return request({
    url: "/apisecurity/sensitiveStrategy/getAllStrategy",
    method: "get",
    params: data,
  });
}

//设置全局脱敏策略
export function addAll(data) {
  return request({
    url: "/apisecurity/sensitiveStrategy/addAll",
    method: "post",
    data,
  });
}
